package com.cqq.auth.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.cqq.auth.dao.UserGroupDao;
import com.cqq.auth.dao.domain.UserGroup;
import com.cqq.auth.dao.mapper.UserGroupMapper;
import com.cqq.common.core.base.BaseDao;
import com.cqq.common.core.base.BaseQuery;

/**
 * <h3>用户组Dao接口实现类</h3>
 * 
 * @author xijq
 * @version 1.0.0
 * 
 */
@Repository("userGroupDao")
public class UserGroupDaoImpl extends BaseDao implements UserGroupDao {
	
	@Autowired
	private UserGroupMapper userGroupMapper;

	
	public void add(UserGroup obj) {
		userGroupMapper.add(obj);
	}

	
	public Integer delete(Serializable id) {
		return userGroupMapper.delete(id);
	}

	
	public Integer update(UserGroup obj) {
		return userGroupMapper.update(obj);
	}

	
	public UserGroup queryById(Serializable id) {
		return userGroupMapper.queryById(id);
	}

	
	public List<UserGroup> queryAll() {
		return userGroupMapper.queryAll();
	}

	
	public List<UserGroup> queryPage(BaseQuery query) {
		return userGroupMapper.queryPage(query);
	}

	
	public Integer queryCount(BaseQuery query) {
		return userGroupMapper.queryCount(query);
	}

	
	public void updateRoleIds(Integer id, Integer[] roleIds) {
		userGroupMapper.updateRoleIds(id, roleIds);
	}

	
	public UserGroup queryByName(String name) {
		return userGroupMapper.queryByName(name);
	}

	
	public List<UserGroup> queryUserGroupByUserId(Integer userId) {
		// TODO Auto-generated method stub
		return userGroupMapper.queryUserGroupByUserId(userId);
	}

}
